package com.chencong.online.function;

import com.chencong.online.bean.AdClinkBehaviorBean;
import org.apache.flink.api.common.functions.AggregateFunction;

/**
 * @program: user-behavior-analysis-online
 * @ClassName AdClinkCountAggFunc
 * @description:窗口内数据增量聚合
 * @author: chencong
 * @create: 2021-12-29 15:21
 **/
public class AdClinkCountAggFunc implements AggregateFunction<AdClinkBehaviorBean, Long, Long> {
    @Override
    public Long createAccumulator() {
        return 0L;
    }

    @Override
    public Long add(AdClinkBehaviorBean value, Long accumulator) {
        return accumulator + 1;
    }

    @Override
    public Long getResult(Long accumulator) {
        return accumulator;
    }

    @Override
    public Long merge(Long a, Long b) {
        return null;
    }
}
